package com.qingke.qixi;

import java.util.Scanner;


public class Console {

	static Scanner scanner = new Scanner(System.in);
	public static void println(Object object){
		System.out.println(object);
	}
	
	public static void print(Object object){
		System.out.print(object);
	}
	
	public static String askInput(String string){
		print(string+">");
		String input = scanner.nextLine();
		return input.trim();
	}
	
	public static int askInputInt(String string){
		String input=null;
		while(true){
			print(string+">");
			try {
				input= scanner.nextLine();
				int number = Integer.parseInt(input);
				return number;
			} catch (Exception e) {
				Console.println("请输入合法的数字");
			}
		}
	}
	
	public static void printHelp(){
		Console.println("=====帮助信息=====");
		Console.println("帮助信息               help（实现）");
		Console.println("用户注册               signup（实现）");
		Console.println("用户登录               login（实现）");
		Console.println("翻牌用户               list（实现）");
		Console.println("新增信息               new（代表性实现一个）");
		Console.println("更改信息               update（同上）");
		Console.println("退出登录               logout（实现）");
		Console.println("关闭程序               exit（实现）");
		Console.println("==============");
	}
	
}
